package com.pms.service;

import java.util.List;

import com.pms.dao.UserDao;
import com.pms.entity.User;
import com.pms.entity.UserProject;
import com.pms.util.PKUtil;

public class UserService {
	UserDao userDao=new UserDao();

	public void save(String userName,String password,String nickName,String pictureName){
		User user=new User();
		user.setUserId(PKUtil.getPkId());
		user.setUserName(userName);
		user.setPassword(password);
		user.setNickName(nickName);
		user.setPicture(pictureName);
		userDao.save(user);
	}
	
	public User findByName(String nickName){
		return userDao.FindByName(nickName);
		
	}
	
	
	
	
	public List<User> findAlluser(){
		List<User> userList=userDao.findAllUser();
		return userList;
	}
	
	
	
	
	public List<User> findProjectId(UserProject up) {
		return userDao.findByProjectId(up);
	}
	
	
	
	
	public User findByid(String manager) {
		return userDao.findById(manager);
	}

	
}
